package com.hailian.fintech.autoconfig;

import com.hailian.fintech.service.AlipayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(AlipayProperties.class)
@ConditionalOnClass(AlipayService.class)
public class AlipayAutoConfig {

    @Autowired
    private AlipayProperties alipayProperties;
    @Bean
    public AlipayService alipayService(){
        return new AlipayService(alipayProperties);
    }
}
